//
//  GYOrderAddressCell.m
//  GoodLuck
//
//  Created by apple on 2018/3/20.
//  Copyright © 2018年 yunjiazhineng. All rights reserved.
//

static NSString *orderCellIdentifier = @"orderCellIdentifier";


#import "GYOrderAddressCell.h"

@interface GYOrderAddressCell()

@property (weak, nonatomic) IBOutlet UILabel *userNameLable;
@property (weak, nonatomic) IBOutlet UILabel *userPhoneLable;
@property (weak, nonatomic) IBOutlet UILabel *userAddressLable;

@end

@implementation GYOrderAddressCell

- (void)awakeFromNib {
    [super awakeFromNib];
}

+ (instancetype)cellWithTableView:(UITableView *)tableView {
    GYOrderAddressCell *cell = [tableView dequeueReusableCellWithIdentifier:orderCellIdentifier];
    if (cell == nil) {
        cell = [[[NSBundle mainBundle]loadNibNamed:NSStringFromClass([self class]) owner:nil options:nil] firstObject];
    }
    
    return cell;
}

- (CGFloat)height:(GYRecriveAddress *)model {
    
    self.model = model;
    
    [self layoutIfNeeded];
    
    return CGRectGetMaxY(self.userAddressLable.frame)+15;
}

- (void)setModel:(GYRecriveAddress *)model {
    _model = model;
    
    self.userNameLable.text = model.true_name == nil ? @"" :model.true_name;
    self.userPhoneLable.text = model.mob_phone == nil ? @"" : model.mob_phone;
    self.userAddressLable.text = [NSString stringWithFormat:@"%@ %@",model.area_info == nil ? @"" :model.area_info,model.address == nil ? @"" : model.address];
}
@end
